'   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '           N a m e :   W X M _ D o o r L o c k B T _ 6 . t x t                                           D a t e :   2 2   M a y   2 0 2 0 
 
 '         A u t o r :   L e o n a r d o   D E   P A L O 
 
 '         S c o p e :   T e s t   D o o r   l o c k   s m a r t   p h o n e   B l u e   T o o t h   b a s e d . 
 
 '   H a r d w a r e :   S t a n d a r d   M a s t e r . 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 L o a d   B T _ f i n g e r _ e m u l a t o r . j p g 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T E P P E R   M O T O R S 
 
 N u m M o t o r s   =   4   '   < < <   U s e d   b y   W a i t A l l M o t o r s 
 
 
 
 S l o t _ M o t o r X               =   1 
 
 S l o t _ M o t o r Y               =   3 
 
 S l o t _ M o t o r A               =   2 5 
 
 S l o t _ M o t o r Z               =   5 
 
 
 
 S l o t _ S e n s o r X             =   1 9 
 
 S l o t _ S e n s o r Y             =   2 0 
 
 S l o t _ S e n s o r A             =   3 1 
 
 S l o t _ S e n s o r Z             =   2 1 
 
 
 
 S l o t _ E n a b l e M o t o r s   =   1 1 
 
 
 
 S L O T _ P E N                     =   1 3 
 
 
 
 S l o t _ L A S E R                 =   3 0 
 
 S l o t _ L o c k S e n s o r       =   3 2 
 
 
 
 P E N _ D O W N                     =   2 3 2 
 
 P E N _ U P                         =   2 8 0 
 
 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O G   F I L E   S E T   U P 
 
 V a r i a b l e   S t r i n g   F i l e H e a d e r 
 
 V a r i a b l e   S t r i n g   L o g F i l e N a m e 
 
 L o g F i l e N a m e   =   " T e s t L o g D o o r L o c k B T . t x t " 
 
 F i l e H e a d e r   =   C R L F 
 
 F i l e H e a d e r   =   F i l e H e a d e r   +   " -   D A T E   -   "   +   "   -   T I M E   -   "   +   "   C Y C L E   " 
 
 F i l e H e a d e r   =   F i l e H e a d e r   +   "   R E S U L T   "   +   "         N U M .   "   +   "         R A T E   I N   % " 
 
 ' F i l e H e a d e r   =   F i l e H e a d e r   +   " -   =   -   =   -   =   -     S T A R T     -   =   -   =   -   =   -   " 
 
 S a v e   S t r i n g T o F i l e   F i l e H e a d e r   L o g F i l e N a m e 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L O A D   A P P S 
 
 L o a d   . . \ T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e 
 
 L o a d   . . \ T h e r e m i n o _ H A L \ T h e r e m i n o _ S l o t V i e w e r . e x e 
 
 
 
 K e y   R i g h t 	 	 G o s u b   M o v e R i g h t 
 
 K e y   L e f t   	 	 G o s u b   M o v e L e f t 
 
 K e y   U p   	 	 	 G o s u b   M o v e F a r 
 
 K e y   D o w n   	 	 G o s u b   M o v e N e a r 
 
 K e y   P a g e u p   	 	 G o s u b   M o v e U p 
 
 K e y   P a g e d o w n   	 G o s u b   M o v e D o w n 
 
 K e y   A   	 	 	 G o s u b   M o v e A f a r 
 
 K e y   Z   	 	 	 G o s u b   M o v e A n e a r 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T A R T 
 
 G o s u b   P E N   U P 
 
 O p t i o n   S p e e d   9 
 
 
 
 ' W i n d o w   M i n S i z e 
 
 
 
 C O M   O p e n   1   1 1 5 2 0 0                   '   H o m e 
 
 
 
 B u t t o n     1   T e x t     H o m e   
 
 B u t t o n     1   C o l o r   G r e e n 9 
 
 B u t t o n     2   T e x t     H o m e _ X   
 
 B u t t o n     2   C o l o r   G r e e n Y e l l o w 
 
 ' B u t t o n     3   T e x t     H o m e _ Y   
 
 ' B u t t o n     3   C o l o r   G r e e n Y e l l o w 
 
 B u t t o n     4   T e x t     H o m e _ A   
 
 B u t t o n     4   C o l o r   G r e e n Y e l l o w 
 
 B u t t o n     5   T e x t     H o m e _ Z   
 
 B u t t o n     5   C o l o r   G r e e n Y e l l o w 
 
 
 
 B u t t o n     7   T e x t     C O N T I N U E   T E S T   
 
 B u t t o n     7   C o l o r   Y e l l o w 9 
 
 B u t t o n     8   T e x t     P E N   U P   
 
 B u t t o n     8   C o l o r   L i g h t S t e e l B l u e 
 
 B u t t o n     9   T e x t     P E N   D O W N   
 
 B u t t o n     9   C o l o r   L i g h t S t e e l B l u e 
 
 B u t t o n   1 0   T e x t     P E N   S I N G L E   
 
 B u t t o n   1 0   C o l o r   L i g h t S t e e l B l u e 
 
 B u t t o n   1 1   T e x t     r e - s t a r t   t e s t   
 
 B u t t o n   1 1   C o l o r   Y e l l o w 9 
 
 
 
 
 
 
 
 B u t t o n   1 3   T e x t     E N A B L E   M O T   
 
 B u t t o n   1 3   C o l o r   Y e l l o w G r e e n 
 
 B u t t o n   1 4   T e x t     D I S A B L E   M O T   
 
 B u t t o n   1 4   C o l o r   G o l d 
 
 
 
 B u t t o n   1 6   T e x t     C L O S E   A L L   
 
 B u t t o n   1 6   C o l o r   O r a n g e R e d 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r X 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r Y 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r A 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r Z 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r X 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r Y 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r A 
 
 V a r i a b l e   N u m e r i c   S l o t _ S e n s o r Z 
 
 V a r i a b l e   N u m e r i c   S l o t _ E n a b l e M o t o r s 
 
 V a r i a b l e   N u m e r i c   S l o t _ L A S E R 
 
 V a r i a b l e   N u m e r i c   S l o t _ L o c k S e n s o r 
 
 
 
 G o s u b   L o a d V a r s 
 
 W a i t   S e c o n d s   1 
 
 L o a d   H i d e 
 
 ' G o s u b   " M e c h T e s t " 
 
 S t o p 
 
 
 
 
 
 '   = = = = = = = = = = = = = = =     S a v e ,   L o a d   a n d   C l e a r   V A R S     = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   S a v e V a r s 
 
 	 v 1   =   N u m C y c l e 
 
 	 v 2   =   E r r o r N u m b e r 
 
 	 S a v e   V a r s 
 
 R e t u r n 
 
 
 
 L a b e l   L o a d V a r s 
 
 	 L o a d   V a r s 
 
 	 N u m C y c l e   =   v 1 
 
 	 E r r o r N u m b e r   =   v 2 
 
 R e t u r n 
 
 
 
 L a b e l   C l e a r V a r s 
 
 	 N u m C y c l e   =   0 
 
 	 E r r o r N u m b e r   =   0 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     T E S T 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   N u m C y c l e 
 
 V a r i a b l e   N u m e r i c   E r r o r N u m b e r 
 
 V a r i a b l e   N u m e r i c   E r r o r P e r c e n t a g e 
 
 V a r i a b l e   N u m e r i c   R e d F l a s h 
 
 V a r i a b l e   S t r i n g     R e s u l t 
 
 
 
 L a b e l   C O N T I N U E   T E S T 
 
 	 S a v e   S t r i n g T o F i l e   F i l e H e a d e r   F i l e N a m e 
 
 	 G o s u b   H o m e 
 
 	 F o r   N u m C y c l e   =   N u m C y c l e   T o   6 0 0 0 0 
 
 	 	 G o s u b   S a v e V a r s 
 
 	 	 
 
 	 	 S e q u e n c e F i l e N a m e   =   " S E Q U E N C E S \ H a n d l e D o w n . s e q " 
 
 	 	 G o s u b   E x e c S e q u e n c e 
 
 	 	 
 
                 ' - - - - - - - - - - - - - - - - - -   l a s e r   o n   a n d   t e s t 
 
 	 	 S l o t ( S l o t _ L A S E R )   =   1 0 0 0         '   L A S E R   O N 
 
 	 	 W a i t   S e c o n d s   0 . 2 
 
 	 	 
 
 	 	 I f   S l o t ( S l o t _ L o c k S e n s o r )   >   5 0 0 
 
 	 	 	 G o s u b   T E S T   P A S S E D 
 
 	 	 E l s e 
 
 	 	 	 G o s u b   T E S T   F A I L 
 
 	 	 E n d I f 
 
 	 	 
 
 	 	 S l o t ( S l o t _ L A S E R )   =   0         '   L A S E R   O F F 
 
 	 	 W a i t   S e c o n d s   1 
 
 	 	 
 
 	 	 S e q u e n c e F i l e N a m e   =   " S E Q U E N C E S \ H a n d l e U p . s e q " 
 
 	 	 G o s u b   E x e c S e q u e n c e 
 
 	 	 
 
 	 	 P r i n t   " C y c l e   n u m b e r : "   +   N u m C y c l e 
 
 ' 	 	 W a i t   S e c o n d s   1 . 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 L a b e l   r e - s t a r t   t e s t 
 
 	 G o s u b   C l e a r V a r s 
 
 	 G o s u b   C O N T I N U E   T E S T 
 
 	 
 
 R e t u r n 
 
 
 
 
 
 L a b e l   T E S T   P A S S E D 
 
 	 G o s u b   G R E E N 
 
 	 R e s u l t   =   "   - P A S S -   " 
 
 	 G o s u b   U P D A T E _ F I L E 
 
 R e t u r n 
 
 
 
 L a b e l   T E S T   F A I L 
 
 	 G o s u b   R E D 
 
 	 G o s u b   S a v e R e c o r d 
 
 	 L o a d   S o u n d \ D o o r B e l l . w a v 
 
 	 E r r o r N u m b e r   =   E r r o r N u m b e r   +   1 
 
 	 E r r o r P e r c e n t a g e   =   ( 1 0 0   *   E r r o r N u m b e r )   /   N u m C y c l e 
 
 	 R e s u l t   =   "   - F A I L -   "   +   " N u m   E r r : "   +   F o r m a t ( E r r o r N u m b e r ,   " 0 0 0 " )   +   "       % = "   +   F o r m a t ( E r r o r P e r c e n t a g e ,   " 0 0 . 0 0 " ) 
 
 	 G o s u b   U P D A T E _ F I L E 
 
 	 G o s u b   R E D   A L A R M 
 
 R e t u r n 
 
 
 
 L a b e l   U P D A T E _ F I L E 
 
 	 s 1   =   " " 
 
 	 s 1   =   N o w 
 
 	 s 1   =   s 1   +   "   "   +   F o r m a t ( N u m C y c l e ,   " 0 0 0 " )   +   "   "   +   R e s u l t 
 
 	 s 2   =   " T e s t :   "   +   F o r m a t ( N u m C y c l e ,   " 0 0 0 " ) 
 
 	 P r i n t   S 2 
 
 	 S a v e   S t r i n g T o F i l e   s 1   L o g F i l e N a m e 
 
 R e t u r n 
 
 
 
 L a b e l   R E D   A L A R M 
 
 	 L o a d   S o u n d \ A l a r m _ 2 _ t i m e s . w a v 	 	 ' < < < < < < < < < < < < < < < < 
 
 	 F o r   R e d F l a s h   =   1   T o   5 
 
 	 	 G o s u b   B L A C K 
 
 	 	 W a i t   S e c o n d s   0 . 2 
 
 	 	 G o s u b   R E D 
 
 	 	 W a i t   S e c o n d s   0 . 1 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   V   I   D   E   O   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   S t a r t R e c o r d 
 
 	 S l o t ( 4 9 )   =   1 0 0 0 	 	 	 ' 	 S t a r t   r e c o r d i n g 
 
 R e t u r n 
 
 
 
 L a b e l   S t o p R e c o r d 
 
 	 S l o t ( 4 9 )   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   S a v e R e c o r d 
 
 	 S l o t ( 5 0 )   =   1 0 0 0 	 	 	 '   s a v e   t o   f i l e 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 S l o t ( 5 0 )   =         0 
 
 	 S l o t ( 4 9 )   =         0 	 	 	 '   S t o p   r e c o r d i n g   a n d   s a v e   t o   f i l e 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     P E N   U P / D O W N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S L O T _ P E N 
 
 
 
 L a b e l   P E N   U P 
 
 	 M o v e _ S l o t   =   S L O T _ P E N 
 
 	 M o v e _ D e s t   =   P E N _ U P 
 
 	 S l o t ( M o v e _ S l o t )   =   M o v e _ D e s t 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 R e t u r n 
 
 
 
 L a b e l   P E N   D O W N 
 
 	 M o v e _ S l o t   =   S L O T _ P E N 
 
 	 M o v e _ D e s t   =   P E N _ D O W N 
 
 	 S l o t ( M o v e _ S l o t )   =   M o v e _ D e s t 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 R e t u r n 
 
 
 
 L a b e l   P E N   S I N G L E 
 
 	 G o s u b   B L U 
 
 	 G o s u b   P E N   D O W N 
 
 	 W a i t   S e c o n d s   0 . 3 5 
 
 	 G o s u b   P E N   U P 
 
 	 G o s u b   G R E E N 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     L E D   C O L O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R E D 
 
 	 S l o t   1 6   =   8 0 0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' G R E 
 
 	 S l o t   1 8   =         0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   G R E E N 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =     8 0 0 	 	 ' G R E 
 
 	 S l o t   1 8   =         0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   B L U 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' G R E 
 
 	 S l o t   1 8   =     8 0 0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   Y E L L O W 
 
 	 S l o t   1 6   =     7 5 0 	 	 ' R E D 
 
 	 S l o t   1 7   =     6 0 0 	 	 ' G R E 
 
 	 S l o t   1 8   =     6 0 0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   W H I T E 
 
 	 S l o t   1 6   =     7 5 0 	 	 ' R E D 
 
 	 S l o t   1 7   =     7 5 0 	 	 ' G R E 
 
 	 S l o t   1 8   =     7 5 0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 L a b e l   B L A C K 
 
 	 S l o t   1 6   =         0 	 	 ' R E D 
 
 	 S l o t   1 7   =         0 	 	 ' G R E 
 
 	 S l o t   1 8   =         0 	 	 ' B L U 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E Q U E N C E   L O A D I N G   A N D   E X E C U T I O N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   S t r i n g   S e q u e n c e F i l e N a m e 
 
 V a r i a b l e   S t r i n g   S e q u e n c e 
 
 V a r i a b l e   S t r i n g   S e q u e n c e C m d 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e I n d e x 
 
 V a r i a b l e   N u m e r i c   S e q u e n c e L e n g t h 
 
 
 
 L a b e l   E x e c S e q u e n c e 
 
 	 L o a d   S e q u e n c e   S e q u e n c e F i l e N a m e 
 
 	 I f   L e n ( S e q u e n c e )   =   0 
 
 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 P r i n t   C R L F   +   "   S e q u e n c e   f i l e   n o t   f o u n d :   "   +   S e q u e n c e F i l e N a m e 
 
 	 	 B e e p 
 
 	 	 S t o p 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 V a r i a b l e   N u m e r i c   E x e c S e q u e n c e S t a r t T i m e 
 
 	 E x e c S e q u e n c e S t a r t T i m e   =   E l a p s e d T i m e 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 S e q u e n c e L e n g t h   =   G e t S e p a r a t e d S t r i n g C o u n t ( S e q u e n c e ,   C R L F ) 
 
 	 F o r   S e q u e n c e I n d e x   =   0   T o   S e q u e n c e L e n g t h - 1 
 
 	 	 S e q u e n c e C m d   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e ,   S e q u e n c e I n d e x ,   C R L F ) 
 
 	 	 S e q u e n c e C m d   =   R e p l a c e ( S e q u e n c e C m d ,   C h r ( 9 ) ,   "   " )   ' T A B S   t o   S P A C E S 
 
 	 	 S e q u e n c e C m d   =   R e m o v e C o m m e n t s ( S e q u e n c e C m d ) 
 
 	 	 S e q u e n c e C m d   =   T r i m ( S e q u e n c e C m d ) 
 
 	 	 ' 
 
 	 	 P r i n t   "   E x e c u t i n g   c o m m a n d :   "   +   S e q u e n c e C m d 
 
 	 	 ' 
 
 	 	 S e l e c t   U C a s e ( S e q u e n c e C m d ) 
 
                         '   - - - - - - - - - - - - - - - - - - -   e x i t   f r o m   t h e   s e q u e n c e   - - - - - - - - - - - - - 
 
 	 	 	 C a s e   " E N D S E Q " 
 
 	 	 	 	 S e q u e n c e I n d e x   =   S e q u e n c e L e n g t h - 1 
 
 	 	         '   - - - - - - - - - - - - - - - - - - - - -   s i n g l e   a c t i o n s   - - - - - - - - - - - - - - - - - - - 
 
 	 	 	 C a s e   " E N A B L E   M O T O R S "           '   e n a b l e   m o v e m e n t   m o t o r s 
 
 	 	 	 	 G o s u b   E N A B L E   M O T 
 
 	 	 	 C a s e   " D I S A B L E   M O T O R S "         '   d i s a b l e   m o v e m e n t   m o t o r s 
 
 	 	 	 	 G o s u b   D I S A B L E   M O T 
 
 	 	 	 C a s e   " C L O S E   A L L " 
 
 	 	 	 	 G o s u b   C L O S E   A L L 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - -   p e n   a c t i o n s   - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 	 C a s e   " P E N   U P "                         '   m o v e   p e n   u p 
 
 	 	 	 	 G o s u b   P E N   U P 
 
 	 	 	 C a s e   " P E N   D O W N "                     '   m o v e   p e n   d o w n 
 
 	 	 	 	 G o s u b   P E N   D O W N 
 
 	 	 	 C a s e   " P E N   S I N G L E "                 '   s i n g l e   c l i c k 
 
 	 	 	 	 G o s u b   P E N   S I N G L E 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - -   W A I T   M O T O R S   - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 	 C a s e   " W A I T _ M O T O R S " 
 
 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - -   L I G H T   C O L O R S   - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 	 C a s e   " R E D " 
 
 	 	 	 	 G o s u b   R E D 
 
 	 	 	 C a s e   " G R E E N " 
 
 	 	 	 	 G o s u b   G R E E N 
 
 	 	 	 C a s e   " B L U " 
 
 	 	 	 	 G o s u b   B L U 
 
 	 	 	 C a s e   " W H I T E " 
 
 	 	 	 	 G o s u b   W H I T E 
 
 	 	 	 C a s e   " Y E L L O W " 
 
 	 	 	 	 G o s u b   Y E L L O W 
 
 	 	 	 C a s e   " B L A C K " 
 
 	 	 	 	 G o s u b   B L A C K 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - -   H O M E S   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 	 C a s e   " H O M E " 
 
 	 	 	 	 G o s u b   H o m e 
 
 	 	 	 C a s e   " H O M E X " 
 
 	 	 	 	 G o s u b   H o m e _ X 
 
 	 	 	 C a s e   " H O M E Y " 
 
 	 	 	 	 G o s u b   H o m e _ Y 
 
 ' 	 	 	 C a s e   " H O M E A " 
 
 ' 	 	 	 	 G o s u b   " H O M E _ A " 
 
 	 	 	 C a s e   " H O M E Z " 
 
 	 	 	 	 G o s u b   H o m e _ Z 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - -   I s t r u c t i o n   w i t h   p a r a m e t e r s   - - - - - - - - 
 
 	 	 	 C a s e E l s e 
 
 	 	 	 	 s 1   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   0 ) 
 
 	 	 	 	 S e l e c t   U C a s e ( s 1 ) 
 
 	 	 	 	 	 C a s e   " M O V E _ X " 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r X )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 C a s e   " M O V E _ Y " 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Y )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 C a s e   " M O V E _ Z " 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Z )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 C a s e   " M O V E _ X Y " 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r X )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Y )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   2 ) 
 
 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 C a s e   " M O V E _ X Y Z " 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r X )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Y )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   2 ) 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Z )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   3 ) 
 
 	 	 	 	 	 C a s e   " M O V E _ X A Z " 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r X )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r A )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   2 ) 
 
 	 	 	 	 	 	 S l o t ( S l o t _ M o t o r Z )   =   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   3 ) 
 
 	 	 	 	 	 	 G o s u b   W a i t A l l M o t o r s 
 
 	 	 	 	 	 C a s e   " P A U S E " 
 
 	 	 	 	 	 	 W a i t   S e c o n d s   G e t S e p a r a t e d S t r i n g ( S e q u e n c e C m d ,   1 ) 
 
 	 	 	 	 	 C a s e E l s e 
 
 	 	 	 	 	 	 I f   s 1   < >   " " 
 
 	 	 	 	 	 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 	 	 	 	 	 P r i n t   C R L F   +   "   U n r e c o g n i z e d   c o m m a n d :   "   +   S e q u e n c e C m d 
 
 	 	 	 	 	 	 	 B e e p 
 
 	 	 	 	 	 	 	 S t o p 
 
 	 	 	 	 	 	 E n d I f 
 
 	 	 	 	 E n d S e l e c t 
 
 	 	 E n d S e l e c t 
 
 	 N e x t 
 
 	 S e q u e n c e F i l e N a m e   =   R e p l a c e ( S e q u e n c e F i l e N a m e , " . s e q " , " " ) 
 
 	 P r i n t   S e q u e n c e F i l e N a m e   +   "   e x e c u t e d   i n   "   +   F o r m a t ( E l a p s e d T i m e   -   E x e c S e q u e n c e S t a r t T i m e ,   " 0 . 0 0 " )   +   "   s e c o n d s " 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M E   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m e 
 
 	 G o s u b   E N A B L E   M O T 
 
 	 G o s u b   H o m e _ Z 
 
 	 G o s u b   H o m e _ X 
 
 	 ' G o s u b   " H o m e _ Y " 
 
 	 G o s u b   H o m e _ A 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H O M I N G   M 0   M 1   M 2 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m e _ X 
 
 	 G o s u b   E N A B L E   M O T 
 
 	 S l o t M o t o r   =   S l o t _ M o t o r X 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r X 
 
 	 S p e e d S e a r c h   =   - 0 . 1     	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   + 0 . 0 1 	         '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d Z e r o   =   0 	 	 '   d e c l a r e d   s w i t c h   p o s i t i o n 
 
 	 I n i t i a l P o s i t i o n   =   2   	 '   m o v e   t o   t h i s   p o s i t i o n 
 
 	 G o s u b   H o m e M o t o r 
 
 	 ' G o s u b   P r i n t V a l u e s 
 
 	 B u t t o n   2   C o l o r   S k y B l u e 
 
 R e t u r n 
 
 
 
 L a b e l   H o m e _ Y 
 
 	 G o s u b   E N A B L E   M O T 
 
 	 S l o t M o t o r   =   S l o t _ M o t o r Y 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r Y 
 
 	 S p e e d S e a r c h   =   - 0 . 1 	 	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   0 . 0 1 5 	 '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d Z e r o   =   0 	 	 '   d e c l a r e d   s w i t c h   p o s i t i o n 
 
 	 I n i t i a l P o s i t i o n   =   2   	 '   m o v e   t o   t h i s   p o s i t i o n 
 
 	 G o s u b   H o m e M o t o r 
 
 	 ' G o s u b   P r i n t V a l u e s 
 
 	 B u t t o n   3   C o l o r   S k y B l u e 
 
 R e t u r n 
 
 
 
 L a b e l   H o m e _ A 
 
 	 G o s u b   E N A B L E   M O T 
 
 	 S l o t M o t o r   =   S l o t _ M o t o r A 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r A 
 
 	 S p e e d S e a r c h   =   - 0 . 1 	 	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   0 . 0 1 5 	 	 '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d Z e r o   =   0 	 	 '   d e c l a r e d   s w i t c h   a n g l e 
 
 	 I n i t i a l P o s i t i o n   =   2 	 '   m o v e   t o   t h i s   a n g l e 
 
 	 G o s u b   H o m e M o t o r 
 
 	 ' G o s u b   P r i n t V a l u e s 
 
 	 B u t t o n   4   C o l o r   S k y B l u e 
 
 R e t u r n 
 
 
 
 L a b e l   H o m e _ Z 
 
 	 G o s u b   E N A B L E   M O T 
 
 	 S l o t M o t o r   =   S l o t _ M o t o r Z 
 
 	 S l o t S e n s o r   =   S l o t _ S e n s o r Z 
 
 	 S p e e d S e a r c h   =   0 . 1 	 	 '   s e a r c h   d i r e c t i o n   a n d   s p e e d 
 
 	 S p e e d R e t u r n   =   - 0 . 0 2 	 	 '   r e t u r n   d i r e c t i o n   a n d   s p e e d 
 
 	 D e c l a r e d Z e r o   =   1 9 2 	 	 '   d e c l a r e d   s w i t c h   a n g l e 
 
 	 I n i t i a l P o s i t i o n   =   1 9 0 	 '   m o v e   t o   t h i s   a n g l e 
 
 	 G o s u b   H o m e M o t o r 
 
 	 ' G o s u b   P r i n t V a l u e s 
 
 	 B u t t o n   5   C o l o r   S k y B l u e 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H o m e   t h e   M o t o r ( S l o t M o t o r )   t o   t h e   S e n s o r ( S l o t S e n s o r ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S l o t M o t o r 
 
 V a r i a b l e   N u m e r i c   S l o t S e n s o r 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e c l a r e d Z e r o 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 L a b e l   H o m e M o t o r 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   i f   s e n s o r   i s   a c t i v e 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   s e a r c h   t h e   s e n s o r 
 
 L a b e l   S e a r c h H o m e 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d S e a r c h 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t ( S l o t S e n s o r )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 G o t o   D e t a c h S e n s o r 
 
 	 E n d I f 
 
 G o t o   S e a r c h H o m e 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   f r o m   t h e   s e n s o r 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t M o t o r )   =   S l o t ( S l o t M o t o r )   +   S p e e d R e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t S e n s o r )   <   5 0 0 
 
 	 	 G o s u b   W a i t M o t o r 
 
 	 	 G o t o   A s s i g n Z e r o 
 
 	 E n d I f 
 
 G o t o   D e t a c h S e n s o r 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   r e s e t   a n d   m o v e   t o   I n i t i a l P o s 
 
 L a b e l   A s s i g n Z e r o 
 
 	 S l o t ( S l o t M o t o r )   =   R e s e t 
 
 	 W a i t   S e c o n d s   0 . 0 8 
 
 	 S l o t ( S l o t M o t o r )   =   D e c l a r e d Z e r o 
 
 	 G o s u b   W a i t M o t o r 
 
 	 S l o t ( S l o t M o t o r )   =   I n i t i a l P o s i t i o n 
 
 	 G o s u b   W a i t M o t o r 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E R V O - M O T O R S   M O V E M E N T S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   P E N _ D O W N 
 
 V a r i a b l e   N u m e r i c   P E N _ U P 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   t h e   m o t o r ( S l o t M o t o r )   i s   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   W a i t M o t 1 
 
 L a b e l   W a i t M o t o r 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 F o r   W a i t M o t 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t M o t o r   +   1 ) )   <   0 . 0 1 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   a l l   t h e   M o t o r s   a r e   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 1   '   < < <   e n s u r e s   t h a t   m o t o r s   a r e   r e a l l y   s t a r t e d 
 
 	 F o r   M o t o r N u m b e r   =   0   T o   N u m M o t o r s   -   1 
 
 	 	 G o s u b   M o t o r N u m b e r T o S l o t 
 
 	 	 I f   A b s ( S l o t ( S l o t F r o m M o t o r N u m b e r   +   1 ) )   >   0 . 0 1 
 
 	 	 	 M o t o r N u m b e r   =   - 1 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E R V O - M O T O R S   M O V E   S L O W 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   M o v e _ S l o t 
 
 V a r i a b l e   N u m e r i c   M o v e _ S p e e d 
 
 V a r i a b l e   N u m e r i c   M o v e _ D e s t 
 
 V a r i a b l e   N u m e r i c   M o v e _ P o s 
 
 
 
 L a b e l   M o v e S l o w 
 
 	 M o v e _ P o s   =   S l o t ( M o v e _ S l o t ) 
 
 	 I f   M o v e _ D e s t   >   M o v e _ P o s 
 
 	 	 M o v e _ P o s   =   M o v e _ P o s   +   M o v e _ S p e e d 
 
 	 	 I f   M o v e _ P o s   >   M o v e _ D e s t 
 
 	 	 	 M o v e _ P o s   =   M o v e _ D e s t 
 
 	 	 E n d I f 
 
 	 E l s e 
 
 	 	 M o v e _ P o s   =   M o v e _ P o s   -   M o v e _ S p e e d 
 
 	 	 I f   M o v e _ P o s   <   M o v e _ D e s t 
 
 	 	 	 M o v e _ P o s   =   M o v e _ D e s t 
 
 	 	 E n d I f 
 
 	 E n d I f 
 
 	 S l o t ( M o v e _ S l o t )   =   M o v e _ P o s 
 
 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 I f   M o v e _ P o s   =   M o v e _ D e s t 
 
 	 	 R e t u r n 
 
 	 E n d I f 
 
 G o t o   M o v e S l o w 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     M O T O R   N U M B E R   T O   S L O T   C O N V E R S I O N 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   N u m M o t o r s 
 
 V a r i a b l e   N u m e r i c   M o t o r N u m b e r 
 
 V a r i a b l e   N u m e r i c   S l o t F r o m M o t o r N u m b e r 
 
 
 
 L a b e l   M o t o r N u m b e r T o S l o t 
 
 	 S e l e c t   M o t o r N u m b e r 
 
 	 	 C a s e   0 
 
 	 	 	 S l o t F r o m M o t o r N u m b e r   =   S l o t _ M o t o r X 
 
 	 	 C a s e   1 
 
 	 	 	 S l o t F r o m M o t o r N u m b e r   =   S l o t _ M o t o r Y 
 
 	 	 C a s e   2 
 
 	 	 	 S l o t F r o m M o t o r N u m b e r   =   S l o t _ M o t o r A 
 
 	 	 C a s e   3 
 
 	 	 	 S l o t F r o m M o t o r N u m b e r   =   S l o t _ M o t o r Z 
 
 	 E n d S e l e c t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       E N A B L E   D I S A B L E   M O T O R S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E N A B L E   M O T 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( S l o t _ E n a b l e M o t o r s )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   D I S A B L E   M O T 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t ( S l o t _ E n a b l e M o t o r s )   =   0 
 
 R e t u r n 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     J O G   W I T H   k e y b o a r d 
 
 '     ( S H I F T   =   x 1 0 0   /   C T R L   =   x 1 0   /   A L T   =   x 0 . 1 ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   M o v e R i g h t 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r X )   =   S l o t ( S l o t _ M o t o r X )   +   J o g S p e e d 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e L e f t 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r X )   =   S l o t ( S l o t _ M o t o r X )   -   J o g S p e e d 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e F a r 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r A )   =   S l o t ( S l o t _ M o t o r A )   +   J o g S p e e d 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e N e a r 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r A )   =   S l o t ( S l o t _ M o t o r A )   -   J o g S p e e d 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e U p 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r Z )   =   S l o t ( S l o t _ M o t o r Z )   +   J o g S p e e d 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e D o w n 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r Z )   =   S l o t ( S l o t _ M o t o r Z )   -   J o g S p e e d 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e A f a r 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r A )   =   S l o t ( S l o t _ M o t o r A )   +   J o g S p e e d 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e A n e a r 
 
 	 G o s u b   S p e e d M o d i f i e r s 
 
 	 S l o t ( S l o t _ M o t o r A )   =   S l o t ( S l o t _ M o t o r A )   -   J o g S p e e d 
 
 R e t u r n 
 
 
 
 V a r i a b l e   N u m e r i c   J o g S p e e d 
 
 L a b e l   S p e e d M o d i f i e r s 
 
 	 J o g S p e e d   =   0 . 1 
 
 	 S e l e c t   T r u e 
 
 	 	 C a s e   K e y ( " S H I F T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 0 
 
 	 	 C a s e   K e y ( " C T R L " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   1 0 
 
 	 	 C a s e   K e y ( " A L T " ) 
 
 	 	 	 J o g S p e e d   =   J o g S p e e d   *   0 . 1 
 
 	 E n d S e l e c t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     R e c e i v e F i l e F r o m C O M 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   R e c e i v e F i l e F r o m C O M 
 
 	 V a r i a b l e   S t r i n g   F i l e N a m e 
 
 	 V a r i a b l e   S t r i n g   S t r 1 
 
 	 ' 
 
 	 C O M   D i s c a r d I n B u f f e r 
 
 	 ' 
 
 	 S t r 1   =   " " 
 
 	 F o r   v 1   =   1   T o   9 e 9 9 
 
 	 	 s 1   =   C O M _ R e c e i v e d 
 
 	 	 I f   s 1   < >   " " 
 
 	 	 	 s 1   =   R e p l a c e ( s 1 ,   " { { { C R L F } } } " ,   C R L F ) 
 
 	 	 	 S t r 1   =   S t r 1   +   s 1 
 
 	 	 	 I f   s 1   =   " { { { F i l e E n d M a r k e r } } } " 
 
 	 	 	 	 S t r 1   =   R e p l a c e ( S t r 1 ,   " { { { F i l e E n d M a r k e r } } } " ,   " " ) 
 
 	 	 	 	 S a v e   D e l e t e F i l e   F i l e N a m e 
 
 	 	 	 	 S a v e   S t r i n g T o F i l e   S t r 1   F i l e N a m e 
 
 	 	 	 	 E x i t 
 
 	 	 	 E n d I f 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     C L O S E   A L L   a n d   E V E N T   S T O P 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   C L O S E   A L L 
 
 	 G o s u b   D I S A B L E   M O T 
 
 	 L o a d   C l o s e A p p s 
 
 R e t u r n 
 
 
 
 L a b e l   E v e n t S t o p 
 
 	 W i n d o w   S i z a b l e 
 
 E n d 
 
 
 
 
 
 ' W A T C H   s 1 
 
 ' E X E C   D e s t X   =   1 2 
 
 